/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ifrr.gepro.estoria.bean;

import br.ifrr.gepro.projeto.bean.ProjetoBean;
import br.ifrr.gepro.sprint.bean.EstDoSprintBean;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author rafael
 */
@Entity
@Table(name = "estorias", catalog = "gepro", schema = "public")

public class EstoriasBean implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_est", nullable = false, insertable= false)
    private Integer idEst;
    @Column(name = "nome", length = 50)
    private String nome;
    @Column(name = "para", length = 250)
    private String para;    
    @Column(name = "como", length = 250)
    private String como;
    @Column(name = "quero", length = 250)
    private String quero;
    @Column(name = "nota", length = 250)
    private String nota;
    @Column(name = "tipo", length = 30)
    private String tipo;
    @Basic(optional = false)
    @Column(name = "importancia", nullable = false)
    private int importancia;
    @Column(name = "data_in")
    @Temporal(TemporalType.DATE)
    private Date dataIn;
    @Column(name = "data_fim")
    @Temporal(TemporalType.DATE)
    private Date dataFim;
//    @OneToMany(mappedBy = "fkEstoria")
//    private Collection<EstDoSprintBean> estDoSprintBeanCollection;
    @JoinColumn(name = "fk_situacao", referencedColumnName = "id_situacao")
    @ManyToOne
    private SituacaoEstoriaBean fkSituacao;
    @JoinColumn(name = "fk_proj", referencedColumnName = "id_projeto")
    @ManyToOne
    private ProjetoBean fkProj;

    public EstoriasBean() {
    }

    public EstoriasBean(Integer idEst) {
        this.idEst = idEst;
    }

    public EstoriasBean(Integer idEst, int importancia) {
        this.idEst = idEst;
        this.importancia = importancia;
    }

    public Integer getIdEst() {
        return idEst;
    }

    public void setIdEst(Integer idEst) {
        this.idEst = idEst;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public int getImportancia() {
        return importancia;
    }

    public void setImportancia(int importancia) {
        this.importancia = importancia;
    }

    public Date getDataIn() {
        return dataIn;
    }

    public void setDataIn(Date dataIn) {
        this.dataIn = dataIn;
    }

    public Date getDataFim() {
        return dataFim;
    }

    public void setDataFim(Date dataFim) {
        this.dataFim = dataFim;
    }

   
    public SituacaoEstoriaBean getFkSituacao() {
        return fkSituacao;
    }

    public void setFkSituacao(SituacaoEstoriaBean fkSituacao) {
        this.fkSituacao = fkSituacao;
    }

    public ProjetoBean getFkProj() {
        return fkProj;
    }

    public void setFkProj(ProjetoBean fkProj) {
        this.fkProj = fkProj;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEst != null ? idEst.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstoriasBean)) {
            return false;
        }
        EstoriasBean other = (EstoriasBean) object;
        if ((this.idEst == null && other.idEst != null) || (this.idEst != null && !this.idEst.equals(other.idEst))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ifrr.gepro.EstoriasBean[ idEst=" + idEst + " ]";
    }

    /**
     * @return the para
     */
    public String getPara() {
        return para;
    }

    /**
     * @param para the para to set
     */
    public void setPara(String para) {
        this.para = para;
    }

    /**
     * @return the como
     */
    public String getComo() {
        return como;
    }

    /**
     * @param como the como to set
     */
    public void setComo(String como) {
        this.como = como;
    }

    /**
     * @return the quero
     */
    public String getQuero() {
        return quero;
    }

    /**
     * @param quero the quero to set
     */
    public void setQuero(String quero) {
        this.quero = quero;
    }

    /**
     * @return the nota
     */
    public String getNota() {
        return nota;
    }

    /**
     * @param nota the nota to set
     */
    public void setNota(String nota) {
        this.nota = nota;
    }
    
}
